<?php
class DictionaryModel extends RelationModel{
	protected $_link=array(
	  	'dictionaryList'=>array(
		    'mapping_type'=>HAS_MANY,//HAS_ONE查询出一条
		    'class_name'=>'DictionaryListModel',//表名
		    'mapping_name'=>'dictionaryList',//表名
            'foreign_key'=>'Id',//外键
            //'mapping_fields'=>array('id','uid','title'),//关联字段
		    //'as_fields'=>'title,id:goodid',//测试一下，可以看一下数组维数有什么变化。
		    //'condition'=>'',//筛选条件
		    //'foreign_key'=>'',//外键
		    //'mapping_fields'=>'',//关联字段
		    //as_fields
		  	//mappling_limit
			//mapping_order
			//parent_key 自引用关联的关联字段，parent_id
	  	),
		'Parent'=> array(
			'mapping_type'=>BELONGS_TO,
			'class_name'=>'DictionaryModel',
			'foreign_key'=>'PARENT_ID',
			'mapping_name'=>'parent',
			'mapping_fields' =>array('id','FL_MC','FL_VALUE'),
		),
		'ChildList'=>array(
			'mapping_type'=>HAS_MANY,//HAS_ONE查询出一条
			'class_name'=>'DictionaryModel',//表名
			'mapping_name'=>'ChildList',//表名
			'foreign_key'=>'PARENT_ID',//外键
			//'mapping_fields'=>array('id','uid','title'),//关联字段
		),
	 );
}
?>